package design.responsibility.demo01;

/**
 * <p>
 * level
 * </P>
 *
 * @author dingwen
 * @date 2021.10.15 10:17
 */
public class Level {
    /**
     * 水平
     */
    private final int level;

    public Level(int level) {
        this.level = level;
    }

    public int getLevel() {
        return level;
    }

    /**
     * 当前等级是否 >= 目标等级
     *
     * @param level 水平
     * @return boolean
     */
    public boolean above(Level level) {
        return this.level >= level.level;
    }

    @Override
    public String toString() {
        return "Level{" +
                "level=" + level +
                '}';
    }
}
